#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{
    int maxn = 1e9, minn = 0;
    int n, a, b;
    cin >> n;
    while (n--)
    {
        cin >> a >> b;
        maxn = min(maxn, (int)floor(a / b));
        minn = max(minn, (int)floor(a / (b + 1)) + 1);
    }
    cout << minn << ' ' << maxn << endl;
    return 0;
}
